# coding=utf-8
# 全世界最帅的帅哥
from flask import Response


# 自定义重定向函数
def redirect_with_headers(url, token):
    response = Response(status=301)
    response.headers['Location'] = url

    # 添加自定义请求头
    response.headers['token'] = token
    # response.json['token'] = token

    response.set_cookie('token', token)

    return response
